﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 会员卡管理系统
{
    public partial class norintfrm : Form
    {
        public norintfrm()
        {
            InitializeComponent();
        }
        Vipclass.tb_viphouseinfo norinfo = new Vipclass.tb_viphouseinfo();
        Vipclass.tbVipHouseMenthod normenthod = new Vipclass.tbVipHouseMenthod();
        private void button1_Click(object sender, EventArgs e)
        {
            norinfo.Bolhousestay = 1;
            if(textBox1.Text==""||textBox2.Text=="")
            {
                MessageBox.Show("输入为空，请重新输入！", "提示");
                return;
            }
            norinfo.Strvipname = textBox1.Text;
            norinfo.Strvipidcard = "(临)" + textBox2.Text;
            norinfo.Strhouseid = this.Text.Trim().Substring(0,3);
            if (normenthod.tbhousefoNoruse(norinfo) == 1)
            {
                MessageBox.Show("入住成功！", "提示");
                this.Close();
            }
            else
            {
                MessageBox.Show("入住失败！", "错误");
                this.Close();
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
